package com.ihr360.job.core.item.database.support;

import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;

/**
 * Factory for creating {@link DataFieldMaxValueIncrementer} implementations
 * based upon a provided string.
 *
 * @author Lucas Ward
 *
 */
public interface DataFieldMaxValueIncrementerFactory {

    /**
     * Return the {@link DataFieldMaxValueIncrementer} for the provided database type.
     *
     * @param databaseType string represented database type
     * @param incrementerName incrementer name to create. In many cases this may be the
     *  sequence name
     * @return incrementer
     * @throws IllegalArgumentException if databaseType is invalid type, or incrementerName
     * is null.
     */
    public DataFieldMaxValueIncrementer getIncrementer(String databaseType, String incrementerName);

    /**
     * Returns boolean indicated whether or not the provided string is supported by this
     * factory.
     */
    public boolean isSupportedIncrementerType(String databaseType);

    /**
     * Returns the list of supported database incrementer types
     */
    public String[] getSupportedIncrementerTypes();
}
